package com.fuzongle.tenant.core.mybatis.handler;


import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.LongValue;
import net.sf.jsqlparser.expression.StringValue;
import org.apache.commons.lang3.StringUtils;


public class TenantGlobalColumnHandler {

    /**
     * 租户列
     **/
    public  static  final  String  COLUMN_TENANT_ID = "tenant_id";
    /**
     * 是否删除列
     **/
    public static final String COLUMN_IS_DELETE = "is_delete";
    /**
     * 更新人列
     **/
    public static final String COLUMN_UPDATED_BY = "update_by";
    /**
     * 创建人列
     **/
    public static final String COLUMN_CREATED_BY = "create_by";
    /**
     * 更新人实体
     **/
    public static final String COLUMN_UPDATED_BY_ENTITY = "updateBy";
    /**
     * 创建人实体
     **/
    public static final String COLUMN_CREATED_BY_ENTITY = "createBy";

    public static Expression getTenantId() {
        String tenantId = "租户ID";
        if (StringUtils.isBlank(tenantId)) {
            throw new RuntimeException("没有获取到系统租户ID");
        }
        return new StringValue(tenantId);
    }

    public static Expression getIsDeleteValue() {
        return new LongValue(0);
    }

}
